﻿<UserControl x:Class="Coding4Fun.BoxingBots.Boxer.Controls.BoxerThumbStick"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Controls="clr-namespace:Coding4Fun.BoxingBots.Boxer.Controls"
			 mc:Ignorable="d">
	<StackPanel Grid.Column="1" Margin="12" >
		<TextBlock FontWeight="Bold" FontSize="16" Text="{Binding Title}" />
		<Controls:Thumbstick 
			HorizontalValue="{Binding HorizontalValue, RelativeSource={RelativeSource AncestorType={x:Type Controls:BoxerThumbStick}}}"
			VerticalValue="{Binding VerticalValue, RelativeSource={RelativeSource AncestorType={x:Type Controls:BoxerThumbStick}}}"
			/>
		<TextBlock FontWeight="Bold"  Margin="0, 12, 0, 0">
			Deadzone Adjustment:
			<Run Text="{Binding ElementName=BoxerVectorDeadzone, Path=Value}" FontWeight="Normal" />
		</TextBlock>
		<Slider
			Name="BoxerVectorDeadzone"
			Orientation="Horizontal" 
			VerticalAlignment="Center" 
			Minimum="0" 
			Maximum="1" 
			IsSnapToTickEnabled="True" 
			TickFrequency="0.01" 
			Value="{Binding AllowedMovementArea, RelativeSource={RelativeSource AncestorType={x:Type Controls:BoxerThumbStick}}}"
			ValueChanged="BoxerVectorDeadzone_ValueChanged" 
			LargeChange="0.2" />
	</StackPanel>
</UserControl>
